With a multimedia stream technology, it is not required to download a complete multimedia file before playing; instead, the multimedia stream can be downloaded gradually and downloaded segments/chunks can be played. With the popularization of wireless and cable broadband network services, it has become a major network application to use a computer or a handheld device to watch multimedia streams through the network. In order to play the multimedia stream smoothly, the received partial stream data needs to be stored in a near-end storage device or a local storage device, and then is output to a playback buffer of a player, so as to be decoded and displayed.
The playback buffer size of a handheld device or a lightweight player is usually relatively small, unknown, or cannot be configured arbitrarily, which causes buffer overflow or underflow, and further results in problems such as unsmooth video playback, image jitter/flicker or freeze while playing. Especially in pursuit of high definition, when the multimedia stream is originated from a high definition video source, problems such as unsmooth video playback, image jitter/flicker or freeze are more likely to occur in a player using a playback buffer with a small size.
To solve the problem of unsmooth video playback, the current player tried to control the output of the playback buffer, so as to acquire stream data from the near-end storage device or from the local storage device for decoding. However, a general control method is implemented based on complex communication protocols such as a Real Time Streaming Protocol (RTSP) and a Real-time Transport Control Protocol (RTCP), and with reference to complicated information such as a network transmission rate, stream bit-rate/data size, or the remaining storage space. Therefore, many lightweight players do not support this function.
In addition, the output control of the buffer is implemented on a software layer of an operating system through a sleep instruction provided by the operation system. Therefore, based on a timestamp of data content, the conventional method fails to perform the precise control on a hardware clock directly. This causes that unpredictable jitters to the time point when the execution of the sleep instruction is started, and to the time point when the execution of the sleep instruction is finished, thereby failing to implement the precise output control of the buffer. The output error also increases with time, which finally causes problems such as unsmooth video playback, image jitter/flicker or even playback freeze.